<%-- 
    Document   : Employee
    Created on : May 9, 2012, 9:28:43 AM
    Author     : Nguyen Hung
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<html>
    <head>

        <script type="text/javascript" language="javascript" src="../scripts/jQuery/confirm.js"></script>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery.fancybox-1.3.4.pack.js"></script>
        <!-- -->
        <link rel="stylesheet" type="text/css" href="../scripts/tabs/slidingtabs-horizontal.css">
        <script type="text/javascript" src="../scripts/tabs/slidetab.js"></script>
        <!-- -->
        <link rel="stylesheet" type="text/css" href="../css/paging.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery.rateit.js"></script>
        <link rel="stylesheet" type="text/css" href="../css/rateit.css">
        <link rel="stylesheet" type="text/css" href="../css/richTable.css"/>
        <link rel="stylesheet" type="text/css" href="../css/thickbox.css"/>
        <link rel="stylesheet" type="text/css" href="../css/cssdivtable.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/thickbox.js"></script>
        <script type="text/javascript" language="javascript">
            var open_cur = 0;
            $j = jQuery.noConflict();
            $j(document).ready(function(){  
                
                initThickBox('.thickbox');
                
                $j('.keysearch').live('keyup',function(){
                    if($j('.keysearch').val() == ""){
                        $j('.noteRow').show();
                                   
                    }else{
                        $j('.noteRow').hide();
                        $j('.noteRow').each(function(){
                            html = $j(this).html();
                            if(   ununicode(html).indexOf(  ununicode($j('.keysearch').val()) ) > -1    )  {
                                $j(this).show();
                            }else{
                                $j(this).hide();
                            }
                        });
                    }

                }); 
                
                $j('.checkComplete').live('change',function(){
                    pb630  = $j(this).attr('lang');
                    if($j(this).is(':checked')){
                        $j.post('actionB630.jsp?action=checkComplete&status=T&pb630='+pb630,function(data){
                            if(data!=null){
                                window.location.href=("workChargeCM.jsp");
                            }
                        });
                    }
                });
                
                $j('.showNote').live('click',function(){
                    var pb630 = $j(this).attr('lang');  
                    var title = $j(this).parent().parent().attr('name');                    
                    $j('.noteContent').slideUp();
                    $j('.noteContent').html(''); 
                    var note = $j(this).parent().parent().next().find('.noteContent');  
                    var title = $j(this).parent().parent().attr('lang');  
                    if(note.hasClass('active')){
                        note.removeClass('active');
                    }else{
                                                 
                        note.removeClass('active');
                        note.addClass('active');                                               
                        // showPleaseWait();                      
                        $j.post('noteWorkCharge.jsp?action=loadB650&pb630='+pb630+"&title="+title,function(data){                      
                            if(data !=null){
                                //                                alert(sms.attr('class'));
                                note.css('min-height','50px');
                                note.html(data);
                                note.slideDown();
                                //  hidePleaseWait();
                            }
                        });
                        //                    }
                     
                    }
                });
                
                $j('.check_select').live('click',function(){
                    var lang= $j(this).attr("lang");
                    var boool;
                    //alert(lang)               
                    if( $j(this).is(":checked"))
                    {
                        boool = true;
                    }
                    else
                    {
                        boool = false;
                    }
                            
                    $j.post("workChargeCM.jsp?action=addCusp100&p100="+lang+"&valueC="+boool+"&kh=CM",function(data){
                            
                    });
                });
                    
                $j(".checkAll").live("click",function(){
                    //alert('check all');
                    flag = $j('.checkAll').is(':checked');
                       
                    $j(".check_select").each(function(){
                        $j('.check_select')  .attr('checked', flag);
                    });
                        
                    var boool;
                    if( $j(this).is(":checked"))
                    {
                        boool = true;
                    }
                    else
                    {
                        boool = false;
                    }
                        
                    $j.post("workChargeCM.jsp?action=addAllCusp100&boool="+boool+"&kh=CM",function(data){
                            
                    });

                });
                $j(".lst_cus_birthday").live("click",function(){
                
                   window.location ="workChargeCM.jsp?action=birthday&kh=CM";
                });
                 $j( "#togglesms" ).hide();
                $j( ".displaySMS" ).click(function() {
                        $j( "#togglesms" ).show();
                        $j( "#togglesms" ).animate({height:'auto',opacity:'0.9'},"slow");
                        $j( "#togglesms" ).animate({width:'39%',opacity:'0.9'},"slow");
                      
                        $j.post("loaddatasmsTour.jsp?action=getlistSMS",function(data){
                            if(data!=null){
                                $j( "#togglesms" ).html(data);
                            }
                        });
                    });
                    $j( ".sendSMS_person" ).click(function() {
                        $j( "#togglesms" ).show();
                        $j( "#togglesms" ).animate({height:'auto',opacity:'0.9'},"slow");
                        $j( "#togglesms" ).animate({width:'39%',opacity:'0.9'},"slow");
                        var info = $j('.sendSMS_person').attr('lang');
                        $j.post("SgtSMS.jsp?action=send_sms_person&"+info,function(data){
                            if(data!=null){
                                $j( "#togglesms" ).html(data);
                            }
                        });
                    });
            });
        </script>
        <style type="text/css"> 
            #main{
                width:100%;
            }
            #content{
                padding:0px !important;
                width:100%;
            }
             .sendSMS_person{
            color: #0055A6;;
            cursor: pointer;
        }
            #footer{
                width:100%;
            }
            .title_tour{
                width:100%;
            }

            #content_detail {
                float: left;
                padding-left: 10px;
                padding-right: 10px;
                width: 98.5%;
            }


            #header_content {
                float: right;
                margin-top: 40px;
                width: 87%;
            }
            .showNote{
                cursor: pointer;
            } 
            .odd {
                background: none repeat scroll 0 0 #E0EFFC;
            }
            .content_table {
                float: left;
                overflow: auto;
                width: 100%;
            }
            .viewData{
                float: left;
                overflow: auto;
                width: 2328px;
            }

            .fields_input{
                float: left;
                margin-top:4px;
                width: 100%;
            }
            .table_subheadercell {
                height: 25px;   
            }
            .noteContent{
                width: 100%;
                height: auto;                
                float:left;
                display : none;
                border-bottom: 1px solid #C4C0C9;
                border-right: 1px solid #C4C0C9;
            }

            input{
                float:left;
                margin-left:9px;
            }
            /*            select{
                            float:left;
                            height: 21px;
                            width:166px;
                            margin-left:9px;
                        }
            */



            .feild_sex td label{width: 150px !important; color:white; font-size:12px; text-transform: none; margin-left:3px;}


            .buttonsms {
                /*  background: url("../images/button_left.gif") repeat-x scroll 0 0 transparent; */
                border: 0 none;
                color: white;
                cursor: pointer;
                float: left;    
                margin-right: 7px !important; 
            }
            .buttonsms span img{
                height: 26px !important; 
                width: 26px !important; 
            }
            .mesage{
                color: red;
                float: left;
                margin-left: 252px;
                margin-top: 20px;
                text-transform: uppercase;

            }
            .btnsend{                
                margin-right: 1px;
            }
            .fotter-page{
                margin-right: 10px;
            }
            .content_right {
                margin-top: -30px;
                width: 100%;
            }
            .cbxEmp {
               float: right;
               margin-right:449px;
               margin-top: -29px;
            }
            .lbl_cbxEmp{
                float:left;
            }
            .cbx_editEmp{
                height: 26px;
                line-height: 26px;
                float:left;
                margin-left: 266px;
            }
            .rich-table-subheadercell {
                border-right: 1px solid #C4C0C9;
                color: #000000;
                font-family: Arial,Verdana,sans-serif;
                font-size: 11px;
                padding: 4px 0;
                text-align: center;
                white-space: nowrap;
            }
            .check_select, .checkComplete{
                margin: auto;
                text-align: center;
                width: 100%;
            }
        #togglesms {
        background: none repeat scroll 0 0 #226579;
        float: left;
        right: 0px;
        margin-top: 100px;
        position: absolute;
        z-index: 999;
        border-radius: 3px;
        border: 1px solid #53B4BF;
    }
.inputSMS{
    background-color: #414D5A;
    color: #FFFFFF;
    float: left;
    height: 30px;
    margin-bottom: 1px;
    padding: 1%;
    width: 98%;
    
}
.inputSMS1{
    background-color: #414D5A;
    color: #FFFFFF;
    float: left;
    height: 102px;
    margin-bottom: 1px;
    padding: 1%;
    width: 98%;
}
.cskh_sgt .rich-table{
  width: 2000px!important;  
}
.blue{
    background-color:  #E0EFFC;
}
        .fast_search1{
            border: 1px solid #B2B7BB !important;
            float: right;
            margin-top: -30px;
        }
        .fast_search1 input[type="text"]{
            height:26px;
            width:220px;
            float:left;
            border:none;

        } 
        .cssgroup3{
            background: none repeat scroll 0 0 #2B3844;
            color: white;
            display: none;
            height: 213px;
            margin-left: -117px;
            position: absolute;
            top: 40px;
            width: 150px;
            z-index: 999;
        }
        .fillter1{
            float: right;
            margin-top:-29px;
            margin-right: 270px;
        }
        .buttonsearch4{
            background: url("../images/btn_search.png") no-repeat scroll 7px 4px transparent;
            border: 0 none;
            color: #FFFFFF;
            cursor: pointer;
            height: 24px;
            text-transform: uppercase;
            width: 31px;
        }
        .buttonsearch4:hover .group{
            display: block ;
        }
        .headerdivtable1 { 
            float:left;
            height: 25px;
            width: 180%;
            background: #4884B5;
            color: #fff;
            font-weight: bold;
            padding: 5px;
        }
        .headerdivtable_over1{
            float:left;
            height: 440px;
            overflow: auto;
            width: 181.5%;
        }
        .checkAll{
            margin-left: 21px;
        }
                </style>
    </head>


    <body>
        <div id="togglesms">

            </div>
        <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
       
        <div id="content">
            <div id="menu_top">
                <div class="dropdown">
                    <div class="select_choise">
                        <a href="#"><span>Khu vực</span></a>
                    </div>
                    <div class="select_hidden">
                        <ul>

                            <li><a href="#"><span>Filter Cấp 3</span></a></li>
                            <li><a href="#"><span>Filter Cấp 3</span></a></li>
                        </ul>
                    </div>
                </div>
                <h:panelGroup rendered="#{loginSession.right.CMA_LST_PAR}">
                    <div class="dropdown">
                        <div class="select_choise">
                            <a href="#">
                                <span class="department2" lang="<h:outputText value="#{n450_n850.fn850}"/>">
                                    <h:outputText rendered="#{n450_n850.fn850 !=0}" value="#{n450_n850.nv851}"/>
                                    <%--      <h:outputText rendered="#{n450_n850.fn850 ==0}" value="Tất cả"/> --%>
                                </span>
                            </a>

                        </div>
                        <div class="select_hidden departmentlistN850">

                            <ul>
                                <%--   <li><a href="#"><span class="department3" lang="<h:outputText value="0"/>">
                                               <h:outputText value="Tất cả"/>
                                           </span></a></li>     --%>                             


                                <a4j:repeat value="#{n450_n850.listComb850}" var="item">
                                    <li><a href="#"><span class="department2" lang="<h:outputText value="#{item.value}"/>">
                                                <h:outputText value="#{item.label}"/>
                                            </span></a></li> 
                                        </a4j:repeat>
                            </ul>
                        </div>
                    </div>
                </h:panelGroup>
                <h:panelGroup >
                    <div class="buttonsms">
                        <span>
                            <h:outputLink style="color:#fff;"   value="popUpSendEmail.jsp?page=workChargeCM&KeepThis=true&amp;TB_iframe=true&amp;height=653&amp;width=741&amp;modal=true" styleClass="thickbox add_new" id="thickbox3"  >
                                <img src="../images/icon_email1.png" alt="Email" title="Gửi email"/>
                            </h:outputLink>                                   

                        </span>

                    </div>
                    
                        <div class="buttonsms">
                        <span>

                            <h:outputLabel style="color:#fff;float:left;" rendered="#{B630Bean.actionChange =='birthday'}" > 
                                <img src="../images/viewSMS.png" class="displaySMS" style="cursor: pointer;" title="Xác nhận  SMS"/>
                            </h:outputLabel>

                            <h:outputLabel styleClass="lst_cus_birthday" id="btnsms" rendered="#{B630Bean.actionChange !='birthday'}" >
                                <img src="../images/icon_sms1.png" alt="Gửi SMS khách hàng có ngày sinh nhật" title="Gửi SMS khách hàng có ngày sinh nhật"/>
                            </h:outputLabel>

                        </span>

                    </div>
                    
                </h:panelGroup>
                <h:panelGroup>
                    <div class="buttonsms">
                        <span>
                            <h:outputLink style="color:#fff;"   value="#" styleClass=""  >
                                <img src="../images/searchnew.png" alt="search" title="Tìm kiếm"/>
                            </h:outputLink>   
                        </span>

                    </div>
                </h:panelGroup>
               <a4j:form>
                    <h:panelGroup rendered="#{loginSession.right.CMA_LST_PAR}">
                        <div class="cbxEmp"> 
                            <h:inputHidden value="#{B630Bean.loginEmp}"/>                                
                            <a4j:region>
                                <h:selectOneMenu  value="#{B630Bean.loginEmp}" styleClass="cbx_editEmp" id="ckb_098">
                                    <f:selectItems value="#{B630Bean.lstEmpByID}" />
                                    <a4j:support event="onchange"  reRender="list630"  actionListener="#{B630Bean.reloadlist}" onsubmit="showPleaseWait();" oncomplete="hidePleaseWait();" > 

                                    </a4j:support>
                                </h:selectOneMenu>
                            </a4j:region>
                        </div>
                    </h:panelGroup>
                    <div class="fillter1">
                        <div class="dropdown">
                            <div class="select_choise">
                                <h:outputLink rendered="#{loginSession.right.CMA_LST_INF}" value="workChargeCM.jsp?action=CM&#{kapiMenu.md5url}"><span><h:outputText value="#{locale.individuals}"/></span>

                                        </h:outputLink>

                            </div>
                            <div class="select_hidden">
                                <ul>
                                    <li>  <h:outputLink rendered="#{loginSession.right.CMA_LST_COM}" value="workChargeCOM.jsp?action=COM&#{kapiMenu.md5url}"><span><h:outputText value="#{locale.company}"/></span>

                                </h:outputLink>

                                    </li>

                                </ul>
                            </div>
                        </div>

                    </div>
                        <h:inputHidden value="#{n450_n850.fn850}"/>
                            <div class="fast_search1">

                                <h:inputText value="#{customerExpand.keySearch}" onfocus="if(this.value=='#{customerExpand.keySearch}')this.value='';" styleClass="keysearch" />
                                <div  style="margin-left:5px; float:left" class="buttonsearch4">
                                    <div class="group cssgroup3">
                                        <h:selectOneRadio layout="pageDirection" value="#{B630Bean.typeSearch}" styleClass="feild_sex"  style="margin-left:5px; margin-top:14px; padding:15px; width:195px; height:153px;"   >
                                            <f:selectItem itemValue="0" itemLabel="Tất cả" />
                                            <f:selectItem itemValue="3" itemLabel="Sinh nhật KH" />
                                            <f:selectItem itemValue="2" itemLabel="Passport hết hạn"/>
                                            <f:selectItem itemValue="1" itemLabel="Ngày kỷ niệm NN"/>
                                            <f:selectItem itemValue="4" itemLabel="Chăm sóc khác"/>


                                        </h:selectOneRadio>
                                        <h:commandButton      action="#{B630Bean.reloadWork}" value="#{locale.search}" style="margin-left:75px; margin-top:5px;" styleClass="buttonsearch2">
                                        </h:commandButton>
                                    </div>
                                </div>
                            </div>

                </a4j:form>
            </div>
            <div id="content_detail">
                <!-- start sidebar sidebar_row1--->
                <%--
                <div class="sidebar_row1">
                    <div class="sidebar">
                       

                        <h:outputLink  rendered="#{loginSession.right.COM_LST_CRE}" value="inccuscompany.jsp?height=236px&width=405px" styleClass="fancybox add_new" id="fancybox">
                            <span> <h:outputText value="#{locale.addCustomer}"/></span>
                        </h:outputLink>

                    </div>
                </div>
                --%>
                <!-- end sidebar row1--->
                <!-- start sidebar row2--->

                <!-- end sidebar row2--->
                <div style="height: 20px">
                    
                </div>
                <div class="content_right">
                    <a4j:form>
                       
                        <div class="content">

                            <!-- Strart list Content -->
                            <div class="list_content">

                                <h:panelGroup id="list630" rendered="#{B630Bean.actionChange !='birthday'}"> 
                                    <div style="height: 10px;width: 100%;line-height: 10px;margin-top: 10px">
                                        

                                    </div>
                                     <div class="content_table cskh_sgt">
                                        <div style="width: 100% !important; overflow: auto;">
                                    <div class="headerdivtable1">
                                        <div class="itemheaderdivtable_center" style="width: 2%;">
                                            <h:selectBooleanCheckbox styleClass="checkAll" />
                                        </div>
                                        <div class="itemheaderdivtable_center" style="width: 4%;">
                                            <h:outputText value="Action" />
                                        </div>
                                        <div class="itemheaderdivtable_center" style="width: 3%;">
                                            <h:outputText value="Hoàn thành" escape="false"/>
                                        </div>
                                        <div class="itemheaderdivtable_center" style="width: 6%;">
                                             <h:outputText value="Tiêu đề" />
                                        </div>
                                        <div class="itemheaderdivtable_center" style="width: 9%;">
                                            <h:outputText value="Hạn mục" />
                                        </div>
                                        <div class="itemheaderdivtable_center" style="width: 10%;">
                                            <h:outputText value="Họ tên" />
                                        </div>
                                        <div class="itemheaderdivtable_center" style="width: 7%;">
                                            <h:outputText value="Số điện thoại" />
                                        </div>
                                        <div  class="itemheaderdivtable_center" style="width: 8%;">
                                            <h:outputText value="Email" />
                                        </div>
                                        <div class="itemheaderdivtable_center" style="width: 10%;">
                                             <h:outputText value="Công ty" />
                                        </div>
                                        <div class="itemheaderdivtable_center" style="width: 9%;">
                                            <h:outputText value="Bắt đầu" />
                                        </div>
                                        <div class="itemheaderdivtable_center" style="width:5%;">
                                            <h:outputText value="Kết thúc" />
                                        </div>
                                        <div class="itemheaderdivtable_center" style="width:10%;">
                                           <h:outputText value="Ghi chú" />
                                        </div>
                                        <div class="itemheaderdivtable_center" style="width:9%;">
                                            <h:outputText value="Người chịu TN" />
                                        </div>
                                        <div class="itemheaderdivtable_center" style="width:8%;">
                                             <h:outputText value="Người cập nhật" />
                                        </div>
                                    </div>
                                    <div class="headerdivtable_over1">
                                        <a4j:repeat  value="#{B630Bean.listAllN630}" var="item" id="table8" rowKeyVar="index" >    
                                            <div class="headerdivtable_bootom <h:outputText rendered="#{index%2 !=0}"  value="headerdivtable_tr"/>">
                                                <div class="itemheaderdivtable_center " style="width: 2%;">
                                                     <h:selectBooleanCheckbox styleClass="check_select" lang="#{item.pb630}"  />
                                                </div>
                                                <div class="itemheaderdivtable_center " style="width: 4%;">
                                                    <h:outputLink  rendered="#{loginSession.right.CMA_LST_MOD}"  value="workChargeInput.jsp?action=edit&page=workChargeCM.jsp&pb630=#{item.pb630}&fq100=#{B630Bean.fq100}&height=300px&width=500px" styleClass="fancybox">
                                                        <img src="../images/edit.png" alt="edit" title="edit"/>
                                                    </h:outputLink>
                                                    <h:outputLink  rendered="#{loginSession.right.CMA_LST_DEL}"  value="deleteB630.jsp?action=delete&page=#{B630Bean.pageRidiect}&fq100=#{item.fq100}&itemid=#{item.fk100}&fb670=#{item.fb670}&pb630=#{item.pb630}&height=150px&width=300px" styleClass="fancybox">
                                                        <img src="../images/delete_1.png" alt="delete"  title="delete" />
                                                    </h:outputLink>
                                                    <h:outputLink rendered="#{loginSession.right.CMA_LST_DES}" value="noteWorkChargeInput.jsp?action=addNote&page=workChargeCM.jsp&pb630=#{item.pb630}&title=#{item.bv631} - #{item.hoten}&height=300px&width=500px" styleClass="fancybox" style="margin-left:3px;">
                                                        <img  alt="Thêm ghi chú" src="../images/qb_email_add.png" width="15px" height="15px">
                                                    </h:outputLink>

                                                    <h:graphicImage rendered="#{loginSession.right.CMA_LST_VDE}" value="../images/history.png" height="15px" width="15px" alt="Ghi chú" title="Ghi chú" styleClass="showNote" lang="#{item.pb630}">                                                            
                                                    </h:graphicImage>
                                                </div>
                                                <div class="itemheaderdivtable_center " style="width: 2%;">
                                                   <h:panelGroup rendered="#{loginSession.right.CMA_LST_CHE && item.bv638 =='A' }">
                                                        <h:selectBooleanCheckbox value="#{B630Bean.checkComplete}" lang="#{item.pb630}" styleClass="checkComplete" style="float:left;"/>
                                                    </h:panelGroup>
                                                    <h:outputText rendered="#{item.bv638 == 'T'}" value="HT" style="text-align: center; width:100%;float: left;"></h:outputText>
                                                   </div>
                                                <div class="itemheaderdivtable_center " style="width: 8%;">
                                                    <h:outputLink value="workChargeCM.jsp?page=customer.jsp">
                                                    <h:outputText value="#{item.bv631}"  escape="false"/>
                                                </h:outputLink>
                                                </div>
                                                <div class="itemheaderdivtable_center " style="width: 9%;">
                                                  <div><h:outputText value="#{item.bv671}"  escape="false"/></div>
                                                </div>
                                                <div class="itemheaderdivtable_center " style="width: 10%;">
                                                    <div>
                                                    <a href='customer.jsp?action=linkCus&pnPN100=<h:outputText value="#{item.fq100}"/>&type=<h:outputText value="#{item.nn104}"/>'>  <h:outputText value="#{item.hoten}"></h:outputText></a> 
                                                    </div>
                                                </div>
                                                <div class="itemheaderdivtable_center " style="width: 5%;">
                                                       <h:outputText style="padding-left:1px" value="#{item.nv108}" styleClass="sendSMS_person phone" lang="page=workChargeCM.jsp&group=1&hoten=#{item.hoten}&phone=#{item.nv108}&fn100=#{item.fq100}"/>
                                                  
                                                </div>
                                                <div  class="itemheaderdivtable_center " style="width: 10%;">
                                                   <div> <h:outputLink style="padding-left:1px" value="popupSendMailPerson.jsp?page=workChargeCM&idx=#{item.fq100}&mailx=#{item.nv105}&typex=workChargeCM&KeepThis=true&amp;TB_iframe=true&amp;height=653&amp;width=741&amp;modal=true" styleClass="thickbox add_new" id="thickbox3"  ><h:outputText value="#{item.nv105}" /></h:outputLink>
                                                    </div>
                                                </div>
                                                <div class="itemheaderdivtable_center " style="width: 10%;">
                                                  <div><h:outputText style="padding-left:1px" value="#{item.kv103}"></h:outputText></div>
                                                </div>
                                                <div class="itemheaderdivtable_center " style="width: 7%;">
                                                  <div><h:outputText style="padding-left:1px" value="#{item.bd632}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>
                                                    </div>
                                                    </div>
                                                <div class="itemheaderdivtable_center " style="width: 7%;">
                                                  <div><h:outputText style="padding-left:1px" value="#{item.bd633}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>
                                                    </div>
                                                   </div>
                                                <div class="itemheaderdivtable_center " style="width: 10%;">
                                                    <div><h:outputText style="padding-left:1px" value="#{item.bv635}"></h:outputText></div>
                                                </div>
                                                <div class="itemheaderdivtable_center " style="width: 7%;">
                                                     <h:outputText style="padding-left:1px" value="#{item.nv106}"></h:outputText>
                                           
                                                </div>
                                                <div class="itemheaderdivtable_center " style="width: 9%;">
                                                  <h:outputText style="padding-left:1px" value="#{item.bl648} "><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText><h:outputText value="<br/>(#{item.bl649})" escape="false"></h:outputText>
                                                    
                                                </div>
                                                  
                                            </div>
                                        </a4j:repeat>
                                    </div>
                                </div>
                                    </div>
                                        <rich:datascroller id="ds8" for="table8" style="margin-right:10px;margin-top:5px;"></rich:datascroller> 
                                        <%--
                                                                                    <div class="rich_table viewData" id="tableData">
                                                                                        <table>
                                                                                            <tr class="table_thead" id="table_header">
                                                                                                <td class="table_subheadercell " style="width: 30px">
                                                                                                <h:selectBooleanCheckbox styleClass="checkAll" />
                                                                                            </td>
                                                                                            <td class="table_subheadercell " style="width: 90px">
                                                                                                <h:outputText value="Action" />
                                                                                            </td>
                                                                                            <td class="table_subheadercell " style="width: 35px">
                                                                                                <h:outputText value="Hoàn<br/> thành" escape="false"/>
                                                                                            </td>
                                                                                            <td class="table_subheadercell " style="width: 200px">
                                                                                                <h:outputText value="#{locale.title}" />
                                                                                            </td>                                               
                                                                                            <td class="table_subheadercell " style="width: 200px">
                                                                                                <h:outputText value="Hạn mục" />
                                                                                            </td>
                                                                                            <td class="table_subheadercell " style="width: 170px">
                                                                                                <h:outputText value="Họ tên" />
                                                                                            </td>
                                                                                            <td class="table_subheadercell " style="width: 80px">
                                                                                                <h:outputText value="Số điện thoại" escape="false"/>
                                                                                            </td>
                                                                                            <td class="table_subheadercell " style="width: 200px">
                                                                                                <h:outputText value="Email"  escape="false"/>
                                                                                            </td>
                                                                                            <td class="table_subheadercell " style="width: 250px">
                                                                                                <h:outputText value="Công ty" />
                                                                                            </td>
                                                                                            <td class="table_subheadercell " style="width: 60px">
                                                                                                <h:outputText value="Trạng thái" escape="false"/>
                                                                                            </td>
                                                                                            <td class="table_subheadercell " style="width: 60px">
                                                                                                <h:outputText value="Bắt đầu" escape="false"/>
                                                                                            </td>
                                                                                            <td class="table_subheadercell " style="width: 60px">
                                                                                                <h:outputText value="Kết thúc" escape="false"/>
                                                                                            </td>
                                                                                            <td class="table_subheadercell " style="width: 250px">
                                                                                                <h:outputText value="Ghi chú" />
                                                                                            </td>
                                                                                            <td class="table_subheadercell " style="width: 250px">
                                                                                                <h:outputText value="Người chịu TN" />
                                                                                            </td>
                                                                                            <td class="table_subheadercell " style="width: 250px">
                                                                                                <h:outputText value="Người cập nhật" />
                                                                                            </td>                                                
                                                                                        </tr>
                                                                                    </table>

                                            <div style="div_content">                                     
                                                <table >
                                                    <a4j:repeat value="#{B630Bean.listAllN630}" var="item" rowKeyVar="index">
                                                        <tr class=" noteRow " lang="<h:outputText value="#{item.bv631} - #{item.hoten}"/>" >
                                                            <td class="table_cell cssHeight cssCenter <h:outputText rendered="#{index%2 !=0}"  value="odd"/> " style="width:30px" >
                                                                <h:selectBooleanCheckbox styleClass="check_select" lang="#{item.pb630}"  />  
                                                            </td> 
                                                            <td class="table_cell cssHeight cssCenter <h:outputText rendered="#{index%2 !=0}"  value="odd"/> " style="width:90px" >

                                                                <h:outputLink  rendered="#{loginSession.right.CMA_LST_MOD}"  value="workChargeInput.jsp?action=edit&page=workChargeCM.jsp&pb630=#{item.pb630}&fq100=#{B630Bean.fq100}&height=300px&width=500px" styleClass="fancybox">
                                                                    <img src="../images/edit.png" alt="edit" title="edit"/>
                                                                </h:outputLink>
                                                                <h:outputLink  rendered="#{loginSession.right.CMA_LST_DEL}"  value="deleteB630.jsp?action=delete&page=#{B630Bean.pageRidiect}&fq100=#{item.fq100}&itemid=#{item.fk100}&fb670=#{item.fb670}&pb630=#{item.pb630}&height=150px&width=300px" styleClass="fancybox">
                                                                    <img src="../images/delete_1.png" alt="delete"  title="delete" />
                                                                </h:outputLink>
                                                                <h:outputLink rendered="#{loginSession.right.CMA_LST_DES}" value="noteWorkChargeInput.jsp?action=addNote&page=workChargeCM.jsp&pb630=#{item.pb630}&title=#{item.bv631} - #{item.hoten}&height=300px&width=500px" styleClass="fancybox" style="margin-left:3px;">
                                                                    <img  alt="Thêm ghi chú" src="../images/qb_email_add.png" width="15px" height="15px">
                                                                </h:outputLink>

                                                                <h:graphicImage rendered="#{loginSession.right.CMA_LST_VDE}" value="../images/history.png" height="15px" width="15px" alt="Ghi chú" title="Ghi chú" styleClass="showNote" lang="#{item.pb630}">                                                            
                                                                </h:graphicImage>



                                                            </td> 
                                                            <td class="table_cell cssHeight cssCenter <h:outputText rendered="#{index%2 !=0}"  value="odd"/> " style="width: 35px">
                                                                <h:panelGroup rendered="#{loginSession.right.CMA_LST_CHE}">
                                                                    <h:selectBooleanCheckbox rendered="#{item.bv638=='A'}" value="#{B630Bean.checkComplete}" lang="#{item.pb630}" styleClass="checkComplete" style="float:left;margin-left:10px"/>
                                                                </h:panelGroup>
                                                            </td>
                                                            <td class="table_cell cssHeight cssLeft <h:outputText rendered="#{index%2 !=0}"  value="odd"/>" style="width: 200px">
                                                                <h:outputLink value="workChargeCM.jsp?page=customer.jsp">
                                                                    <h:outputText value="#{item.bv631}"  escape="false"/>
                                                                </h:outputLink>


                                                            </td>
                                                            <td class="table_cell cssHeight cssLeft <h:outputText rendered="#{index%2 !=0}"  value="odd"/>" style="width: 200px"> 
                                                                <h:outputText value="#{item.bv671}"  escape="false"/>
                                                            </td>
                                                            <td class="table_cell cssHeight cssLeft <h:outputText rendered="#{index%2 !=0}"  value="odd"/>" style="width: 170px;">
                                                                <a href='customer.jsp?action=linkCus&pnPN100=<h:outputText value="#{item.fq100}"/>&type=<h:outputText value="#{item.nn104}"/>'>  <h:outputText value="#{item.hoten}"></h:outputText></a>


                                                                </td>
                                                                <td class="table_cell cssHeight cssCenter <h:outputText rendered="#{index%2 !=0}"  value="odd"/>" style="width: 80px"> 

                                                                <a href="sendSMS.jsp?action=sendSMS&hoten=<h:outputText value="#{item.hoten}" />&pn100=<h:outputText value="#{item.fq100}" />&phone=<h:outputText value="#{item.nv108}" />" class="fancybox actionsendsms"> <h:outputText value="#{item.nv108}" styleClass="phone" lang="#{item.nv108}"/> </h2> <h:outputText rendered="#{item.nv108=='' ||  item.nv108== null}" value="<br/>" escape="false"/></a></h2>
                                                            </td>
                                                            <td class="table_cell cssHeight cssLeft <h:outputText rendered="#{index%2 !=0}"  value="odd"/>" style="width: 200px"> 

                                                                <h:outputLink value="popupSendMailPerson.jsp?page=workChargeCM&idx=#{item.fq100}&mailx=#{item.nv105}&typex=workChargeCM&KeepThis=true&amp;TB_iframe=true&amp;height=653&amp;width=741&amp;modal=true" styleClass="thickbox add_new" id="thickbox3"  ><h:outputText value="#{item.nv105}" /></h:outputLink>
                                                                </td>
                                                                <td class="table_cell cssHeight cssLeft <h:outputText rendered="#{index%2 !=0}"  value="odd"/>" style="width: 250px"> 
                                                                <h:outputText value="#{item.kv103}"></h:outputText>
                                                                </td>
                                                                <td class="table_cell cssHeight cssCenter <h:outputText rendered="#{index%2 !=0}"  value="odd"/>" style="width: 60px"> 
                                                                <h:outputText rendered="#{item.bv638 == 'T'}" value="Hoàn thành"></h:outputText>
                                                                </td>
                                                                <td class="table_cell cssHeight cssCenter <h:outputText rendered="#{index%2 !=0}"  value="odd"/>" style="width: 60px"> 
                                                                <h:outputText value="#{item.bd632}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>
                                                                </td>
                                                                <td class="table_cell cssHeight cssCenter <h:outputText rendered="#{index%2 !=0}"  value="odd"/>" style="width: 60px"> 
                                                                <h:outputText value="#{item.bd633}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>
                                                                </td>
                                                                <td class="table_cell cssHeight cssLeft <h:outputText rendered="#{index%2 !=0}"  value="odd"/>" style="width: 250px"> 
                                                                <h:outputText value="#{item.bv635}"></h:outputText>
                                                                </td>
                                                                <td class="table_cell cssHeight cssCenter <h:outputText rendered="#{index%2 !=0}"  value="odd"/>" style="width: 250px"> 
                                                                <h:outputText value="#{item.nv106}"></h:outputText>
                                                                </td>
                                                                <td class="table_cell cssHeight cssCenter <h:outputText rendered="#{index%2 !=0}"  value="odd"/>" style="width: 250px"> 
                                                                <h:outputText value="#{item.bl648} "><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText><h:outputText value="<br/>(#{item.bl649})" escape="false"></h:outputText>

                                                                </td>                                                    
                                                            </tr>
                                                            <tr>
                                                                <td colspan="14">
                                                                <h:panelGroup rendered="#{index%2 !=0}" id="his_detail1" styleClass="noteContent odd"  >
                                                                </h:panelGroup>
                                                                <h:panelGroup rendered="#{index%2 ==0}" styleClass="noteContent" >
                                                                </h:panelGroup>
                                                            </td>
                                                        </tr>

                                                    </a4j:repeat>
                                                </table>

                                            </div>
                                        </div>
                                        --%>
                                    

                                </h:panelGroup>
                                <h:panelGroup id="listbirthday" rendered="#{B630Bean.actionChange =='birthday'}"> 
                                    <div style="height: 29px;background-color: #4A5763;width: 100%;line-height: 29px;">
                                        <div style="margin-left: 15px;color: white;">
                                            <h:outputText value="CHÚC MỪNG SINH NHẬT KHÁCH HÀNG" style="text-transform:uppercase"/>
                                        </div>

                                    </div>
                                    <div class="content_table ">
                                        <rich:dataTable value="#{B630Bean.n100Birthday}" var="item"
                                                        rows="20"
                                                        rowClasses="greyRow, whiteRow"
                                                        style="float:left "

                                                        width="926px" columnClasses=",columns,columns,columns" rowKeyVar="row"
                                                        id="tableBirth" styleClass="machinePosDataTable">




                                            <rich:column  width="220px" >
                                                <f:facet name="header">
                                                    <h:outputText value="Hạn mục" />
                                                </f:facet>
                                                <div><h:outputText value="Chúc mừng sinh nhật"  escape="false"/></div>
                                            </rich:column>
                                            <rich:column  width="160px" >
                                                <f:facet name="header">
                                                    <h:outputText value="Họ tên" />
                                                </f:facet>
                                                <div>
                                                    <%--<a href='customer.jsp?action=linkCus&pnPN100=<h:outputText value="#{item.fq100}"/>&type=<h:outputText value="#{item.nn104}"/>'>  <h:outputText value="#{item.hoten}"></h:outputText></a>
                                                   --%>
                                                   <h:outputText value="#{item.hoten}"></h:outputText>
                                                </div>
                                            </rich:column>
                                            <rich:column  width="100px" >
                                                <f:facet name="header">
                                                    <h:outputText value="Số điện thoại" />
                                                </f:facet>
                                                <div>
                                                    <%-- <a href="sendSMS.jsp?action=sendSMS&hoten=<h:outputText value="#{item.hoten}" />&pn100=<h:outputText value="#{item.fq100}" />&phone=<h:outputText value="#{item.nv108}" />" class="fancybox actionsendsms"> <h:outputText value="#{item.nv108}" styleClass="phone" lang="#{item.nv108}"/> </h2> <h:outputText rendered="#{item.nv108=='' ||  item.nv108== null}" value="<br/>" escape="false"/></a></h2> --%>
                                                 <h:outputText value="#{cus.nv108}" styleClass="sendSMS_person phone" lang="page=workChargeCM.jsp&group=1&hoten=#{cus.hoten}&phone=#{cus.nv108}&fn100=#{cus.pn100}"/>
                                                   
                                                </div>
                                            </rich:column>
                                                                                  
                                            
                                           
                                        </rich:dataTable>

                                       
                                        </div>
                                        <rich:datascroller id="dsbirthday" for="tableBirth" style="margin-right:10px;margin-top:5px;"></rich:datascroller> 

                                </h:panelGroup>
                            </div>
                            <!-- End List Content-->    
                        </div>
                        <rich:modalPanel id="ajaxLoadingModalBox" minHeight="30" minWidth="40"
                                         height="30" width="40" zindex="2000">
                            <h:outputText value="#{locale.please_wait}" styleClass="startDummer"></h:outputText>
                        </rich:modalPanel>
                    </a4j:form>
                </div>
            </div>
        </div>
   <%--     <div class="fotter-page" >
            <jsp:include page="../../common/pagingCSKH.jsp"/>
        </div> --%>
    </body>
</html>
<script type="text/javascript" language="javascript">
    var open_cur = 0;
    $j = jQuery.noConflict();
    $j(document).ready(function(){
    
        $j(".department2").live("click",function(){
                    
            fh200 = $j(".donvi").attr("lang");
            fn850 = $j(this).attr("lang");
            fn450 = $j(".department1").attr("lang");
            //   showPleaseWait(); 
            dayss = $j('.loadHistory').attr('lang');
            emp =  $j('.cbx_editEmp').children("option:selected").val();
            $j.post("N450_N850.jsp?&action=group&fh200="+fh200+"&fn450="+fn450 +"&fn850="+fn850+"&emp="+emp,function(data){
                if(data!=null){ 
                    window.location.href="workChargeCM.jsp?action=CM&flagFN850=10&d00f4f9aea7c0ce7953be867701d4f68";
                    //       hidePleaseWait();        
                }
            }); 
        });
                
        $j(".department3").live("click",function(){
            //                     alert("department3");
            emp =  $j('.cbx_editEmp').children("option:selected").val();
            fh200 = $j(".donvi").attr("lang");
            fn850 = $j(this).attr("lang");
            fn450 = $j(".department1").attr("lang");
            dayss = $j('.loadHistory').attr('lang');
            // showPleaseWait(); 
            $j.post("N450_N850.jsp?&action=group&fh200="+fh200+"&fn450="+fn450 +"&fn850="+fn850+"&emp="+emp,function(data){
                if(data!=null){ 
                    window.location.href="workChargeCM.jsp?action=CM&flagFN850=10&d00f4f9aea7c0ce7953be867701d4f68";
                    //       hidePleaseWait();        
                }
            }); 
        });
    });
</script>